package com.huluobo.user

import com.huluobo.lib_base.BaseRepo
import com.huluobo.lib_base.entity.User
import com.huluobo.lib_base.room.UserDao
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import javax.inject.Inject

/**
 *  Created by LC on 2025/6/16.
 */
class UserRepo @Inject constructor(private val userDao: UserDao) : BaseRepo() {
    fun register(user: User): Flow<Long> {
        return flow { emit(userDao.register(user)) }
    }

    fun login(username: String, password: String, role: Int): Flow<User> {
        return flow { emit(userDao.login(username, password, role)) }
    }
}